import React, {memo, useEffect,useState} from 'react';
import { shallowEqual, useDispatch, useSelector } from 'react-redux';

import { Table, Tag, Space, Divider, Modal, Spin,Button,message,Upload} from 'antd';
import {UploadOutlined} from '@ant-design/icons';
import { postStudentInfoAction } from '../../store/studentsInfoStore/actionCreators';

//自定义函数


export default memo(function UploadStudentInfo() {
    const props = {
        name: 'file',
        action: 'http://127.0.0.1:8000/api/uoloadStudentInfo',
        headers: {
          authorization: 'authorization-text',
        },
        onChange(info) {
          if (info.file.status !== 'uploading') {
            console.log(info.file, info.fileList);
          }
          if (info.file.status === 'done') {
            message.success(`${info.file.name} file uploaded successfully`);
          } else if (info.file.status === 'error') {
            message.error(`${info.file.name} file upload failed.`);
          }
        },
      };
  

    
    return (
        <div>
            <Divider orientation="left">导入学生信息</Divider>
            <Upload {...props} style={{Left:'100px'}}>
                <Button icon={<UploadOutlined />}>上传学生信息</Button>
            </Upload>
        </div>
    )
})  